//#include "../Misc/part2-3_shared.h"
//
///* Testing the rule creation method */
//
///* 1. create lexicon 
//   2. create a simple rule string (consisting of one term only)
//   3. invoke create rule method on this string
//   4. print the rule that was created
//   5. check printouts */
//
//void test_simple_rule1() {
//	
//	char *lexicon[5];
//	char *simple_rule = "?";
//	int lexicon_size = 5;
//	RULE rule;
//
//	lexicon[0] = "hello";
//	lexicon[1] = "world";
//	lexicon[2] = "car";
//	lexicon[3] = "pooL";
//	lexicon[4] = "life";
//
//	create_rule(&rule,simple_rule,lexicon,lexicon_size);
//
//	if (rule.number_of_terms != 1) {
//		printf("test failed : number of symbols shoud be 1\n");
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != 95) {
//		printf("test failed : wrong number of possible passowrds. expected : 95 found : %d\n", rule.number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != rule.terms[0].number_of_possible_passwords) {
//		printf("test failed : number of possible passwords for rule should the same as for the term in case of a single term\n");
//		return;
//	}
//
//	if (rule.terms[0].number_of_symbols != 1) {
//		printf("test failed : number of symbols shoud be 1\n");
//		return;
//	}
//
//	if (rule.terms[0].symbols[0].number_of_possible_passwords != 95) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 95, but was : %d\n",rule.terms[0].symbols[0].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	printf("test passed\n");
//
//}
//
//void test_simple_rule2() {
//	
//	char *lexicon[5];
//	char *simple_rule = "#^3? +";
//	int lexicon_size = 5;
//	RULE rule;
//
//	lexicon[0] = "h ello";
//	lexicon[1] = "world";
//	lexicon[2] = "car";
//	lexicon[3] = "po oL";
//	lexicon[4] = "life";
//
//	create_rule(&rule,simple_rule,lexicon,lexicon_size);
//
//	if (rule.number_of_terms != 1) {
//		printf("test failed : number of symbols shoud be 1\n");
//	}
//
//	if (rule.number_of_possible_passwords != 104*1111*95) {
//		printf("test failed : wrong number of possible passowrds. expected : 10976680 found : %d\n", rule.number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != rule.terms[0].number_of_possible_passwords) {
//		printf("test failed : number of possible passwords for rule should the same as for the term in case of a single term\n");
//		return;
//	}
//
//	if (rule.terms[0].number_of_symbols != 3) {
//		printf("test failed : number of symbols shoud be 3\n");
//		return;
//	}
//
//	if (rule.terms[0].symbols[0].number_of_possible_passwords != 104) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 95, but was : %d\n",rule.terms[0].symbols[0].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.terms[0].symbols[1].number_of_possible_passwords != 1111) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 1111, but was : %d\n",rule.terms[0].symbols[1].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.terms[0].symbols[2].number_of_possible_passwords != 95) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 95, but was : %d\n",rule.terms[0].symbols[2].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	printf("test passed\n");
//
//}
//
//void test_simple_rule3() {
//	
//	char *lexicon[5];
//	char *simple_rule = "@*2";
//	int lexicon_size = 5;
//	RULE rule;
//
//	lexicon[0] = "hello";
//	lexicon[1] = "world";
//	lexicon[2] = "car";
//	lexicon[3] = "pooL";
//	lexicon[4] = "life";
//
//	create_rule(&rule,simple_rule,lexicon,lexicon_size);
//
//	if (rule.number_of_terms != 1) {
//		printf("test failed : number of symbols shoud be 1\n");
//	}
//
//	if (rule.number_of_possible_passwords != 5*2757) {
//		printf("test failed : wrong number of possible passowrds. expected : 13785 found : %d\n", rule.number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != rule.terms[0].number_of_possible_passwords) {
//		printf("test failed : number of possible passwords for rule should the same as for the term in case of a single term\n");
//		return;
//	}
//
//	if (rule.terms[0].number_of_symbols != 2) {
//		printf("test failed : number of symbols shoud be 2\n");
//		return;
//	}
//
//	if (rule.terms[0].symbols[0].number_of_possible_passwords != 5) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 5, but was : %d\n",rule.terms[0].symbols[0].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	if (rule.terms[0].symbols[1].number_of_possible_passwords != 2757) {
//		printf("test failed : number of possible passwords for symbol %c should be equal to 2757, but was : %d\n",rule.terms[0].symbols[1].symbol, rule.terms[0].symbols[0].number_of_possible_passwords);
//		return;
//	}
//
//	printf("test passed\n");
//
//}
//
//void test_complex_rule1() {
//	
//	char *lexicon[5];
//	char *simple_rule = "#^3?+@*2";
//	int lexicon_size = 5;
//	RULE rule;
//
//	lexicon[0] = "h ello";
//	lexicon[1] = "world";
//	lexicon[2] = "car";
//	lexicon[3] = "po oL";
//	lexicon[4] = "life";
//
//	create_rule(&rule,simple_rule,lexicon,lexicon_size);
//
//	if (rule.number_of_terms != 2) {
//		printf("test failed : number of symbols shoud be 1\n");
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != (5*2757 + 104*1111*95)) {
//		printf("test failed : wrong number of possible passowrds. expected : 10990465 found : %d\n", rule.number_of_possible_passwords);
//		return;
//	}
//
//	printf("test passed\n");
//
//}
//
//void test_complex_rule2() {
//	
//	char *lexicon[6];
//	char *simple_rule = "#^3?+@*2+?";
//	int lexicon_size = 6;
//	RULE rule;
//
//	lexicon[0] = "h ello";
//	lexicon[1] = "world";
//	lexicon[2] = "car";
//	lexicon[3] = "";
//	lexicon[4] = "po oL";
//	lexicon[5] = "life";
//
//	create_rule(&rule,simple_rule,lexicon,lexicon_size);
//
//	if (rule.number_of_terms != 3) {
//		printf("test failed : number of symbols shoud be 3\n");
//		return;
//	}
//
//	if (rule.number_of_possible_passwords != (6*2757 + 105*1111*95 + 95)) {
//		printf("test failed : wrong number of possible passowrds. expected : 11098862 found : %d\n", rule.number_of_possible_passwords);
//		return;
//	}
//
//	printf("test passed\n");
//
//}
//
//int main(int argc, char **argv) {
//	printf("runing simple rule tests...\n");
//	test_simple_rule1();
//	test_simple_rule2();
//	test_simple_rule3();
//	printf("runing simple rule tests...\n");
//	test_complex_rule1();
//	test_complex_rule2();
//}
